package com.ctshk.common.utils.individual;

import com.ctshk.common.utils.individual.airexpress.*;
import com.ctshk.common.utils.individual.scenic.*;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author Lenovo
 * 防腐层util， 将自由行上架设置功能转换成各自实体
 */
public class AnticorrosiveUtil {


    /**
     * 将自由行上架设置功能转换成每个业务的实体 （防腐层）
     *
     * @param scenicProductBatchSaleStrategyReq 门票入参实体（门票对接了前端，故用这个实体做标准）
     * @return 机场快线实体
     */
    public static AirportExpressIncreaseStrategySaveBatchReq scenicChangeAir(ScenicProductBatchSaleStrategyReq scenicProductBatchSaleStrategyReq) {

        AirportExpressIncreaseStrategySaveBatchReq airportExpressIncreaseStrategySaveBatchReq = new AirportExpressIncreaseStrategySaveBatchReq();
        airportExpressIncreaseStrategySaveBatchReq.setAirportExpressIdList(scenicProductBatchSaleStrategyReq.getScenicProductIdList());
        List<AirportExpressIncreaseStrategyReq> airportExpressIncreaseStrategyReqList = new ArrayList<>();
        airportExpressIncreaseStrategySaveBatchReq.setAirportExpressIncreaseStrategyList(airportExpressIncreaseStrategyReqList);
        List<ScenicProductSaleStrategyReq> scenicProductSaleStrategyReqList = scenicProductBatchSaleStrategyReq.getStrategyList();
        for (ScenicProductSaleStrategyReq scenicProductSaleStrategyReq : scenicProductSaleStrategyReqList) {
            AirportExpressIncreaseStrategyReq airportExpressIncreaseStrategyReq = new AirportExpressIncreaseStrategyReq();
            airportExpressIncreaseStrategyReqList.add(airportExpressIncreaseStrategyReq);
            //策略主表
            airportExpressIncreaseStrategyReq.setAirportExpressId(scenicProductSaleStrategyReq.getProductId());
            airportExpressIncreaseStrategyReq.setIncreaseStrategyName(scenicProductSaleStrategyReq.getName());

            //策略时间
            List<ScenicTimeDTO> scenicTimeDTOList = scenicProductSaleStrategyReq.getTime();
            List<AirportExpressIncreaseStrategyDateReq> airportExpressIncreaseStrategyDateReqList = new ArrayList<>();
            AirportExpressIncreaseStrategyDateReq airportExpressIncreaseStrategyDateReq = null;
            for (ScenicTimeDTO scenicTimeDTO : scenicTimeDTOList) {
                airportExpressIncreaseStrategyDateReq = new AirportExpressIncreaseStrategyDateReq();
                airportExpressIncreaseStrategyDateReq.setDateBegin(scenicTimeDTO.getBeginTime());
                airportExpressIncreaseStrategyDateReq.setDateEnd(scenicTimeDTO.getEndTime());
                airportExpressIncreaseStrategyDateReqList.add(airportExpressIncreaseStrategyDateReq);
            }
            airportExpressIncreaseStrategyReq.setAirportExpressIncreaseStrategyDateList(airportExpressIncreaseStrategyDateReqList);
            //渠道加幅规则
            ChannelSaleReq channelSaleReq = scenicProductSaleStrategyReq.getChannelSaleReq();
            //渠道加幅规则-线下自营渠道
            ScenicProductOfflineChannelReq scenicProductOfflineChannelReq = channelSaleReq.getScenicProductOfflineChannelReq();
            airportExpressIncreaseStrategyReq.setSelfSalePermissionType(scenicProductOfflineChannelReq.getVisableType());
            if (airportExpressIncreaseStrategyReq.getSelfSalePermissionType() != null) {
                if (airportExpressIncreaseStrategyReq.getSelfSalePermissionType() == 2) {
                    AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategySelfRule = new AirportExpressIncreaseStrategyRuleReq();
                    //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                    if (scenicProductOfflineChannelReq.getIsLimit() == 0) {
                        airportExpressIncreaseStrategySelfRule.setSaleableType(1);
                    }
                    if (scenicProductOfflineChannelReq.getIsLimit() == 1) {
                        airportExpressIncreaseStrategySelfRule.setSaleableType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setSoldNumber(scenicProductOfflineChannelReq.getLimitNum());
                    // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                    //成人单程
                    if (scenicProductOfflineChannelReq.getAdultOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(1);
                    }
                    if (scenicProductOfflineChannelReq.getAdultOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setAdultOneWayPrice(scenicProductOfflineChannelReq.getChildrenOneWayPrice());
                    //成人往返
                    if (scenicProductOfflineChannelReq.getAdultRoundTripPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(1);
                    }

                    if (scenicProductOfflineChannelReq.getAdultRoundTripPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setAdultRoundTripPrice(scenicProductOfflineChannelReq.getAdultRoundTripPrice());
                    //儿童
                    if (scenicProductOfflineChannelReq.getChildrenOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(1);
                    }

                    if (scenicProductOfflineChannelReq.getChildrenOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(2);
                    }

                    if (scenicProductOfflineChannelReq.getAdjustType() == 0) {
                        //业务类型设置等于1 ,取amount金额
                        scenicProductOfflineChannelReq.getAmount();
                    }
                    if (scenicProductOfflineChannelReq.getAdjustType() == 0) {
                        //业务类型设置等于2，取 percent 百分比
                        scenicProductOfflineChannelReq.getPercent();
                    }
                    airportExpressIncreaseStrategyReq.setAirportExpressIncreaseStrategySelfRule(airportExpressIncreaseStrategySelfRule);
                }
                if (airportExpressIncreaseStrategyReq.getSelfSalePermissionType() == 3) {
                    List<AirportExpressChannelOfflineSelfCustomReq> airportExpressChannelOfflineSelfCustomReqList = new ArrayList<>();

                    List<ScenicProductChannelOfflineSelfCustomReq> scenicProductChannelOfflineSelfCustomReqList = scenicProductOfflineChannelReq.getScenicProductChannelOfflineSelfCustomReqList();
                    for (ScenicProductChannelOfflineSelfCustomReq scenicProductChannelOfflineSelfCustomReq : scenicProductChannelOfflineSelfCustomReqList) {
                        AirportExpressChannelOfflineSelfCustomReq airportExpressChannelOfflineSelfCustomReq = new AirportExpressChannelOfflineSelfCustomReq();
                        airportExpressChannelOfflineSelfCustomReq.setName(scenicProductChannelOfflineSelfCustomReq.getName());
                        airportExpressChannelOfflineSelfCustomReq.setCheckType(scenicProductChannelOfflineSelfCustomReq.getCheckType());
                        airportExpressChannelOfflineSelfCustomReq.setRelationId(scenicProductChannelOfflineSelfCustomReq.getRelationId());
                        AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategySelfRule = new AirportExpressIncreaseStrategyRuleReq();
                        //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                        if (scenicProductChannelOfflineSelfCustomReq.getIsLimit() == 0) {
                            airportExpressIncreaseStrategySelfRule.setSaleableType(1);
                        }
                        if (scenicProductChannelOfflineSelfCustomReq.getIsLimit() == 1) {
                            airportExpressIncreaseStrategySelfRule.setSaleableType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setSoldNumber(scenicProductChannelOfflineSelfCustomReq.getLimitNum());
                        // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                        //成人单程
                        if (scenicProductChannelOfflineSelfCustomReq.getAdultOneWayPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(1);
                        }
                        if (scenicProductChannelOfflineSelfCustomReq.getAdultOneWayPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPrice(scenicProductChannelOfflineSelfCustomReq.getChildrenOneWayPrice());
                        //成人往返
                        if (scenicProductChannelOfflineSelfCustomReq.getAdultRoundTripPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(1);
                        }

                        if (scenicProductChannelOfflineSelfCustomReq.getAdultRoundTripPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPrice(scenicProductChannelOfflineSelfCustomReq.getAdultRoundTripPrice());
                        //儿童
                        if (scenicProductChannelOfflineSelfCustomReq.getChildrenOneWayPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(1);
                        }

                        if (scenicProductChannelOfflineSelfCustomReq.getChildrenOneWayPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(2);
                        }

                        if (scenicProductChannelOfflineSelfCustomReq.getAdjustType() == 0) {
                            //业务类型设置等于1 ,取amount金额
                            scenicProductChannelOfflineSelfCustomReq.getAmount();
                        }
                        if (scenicProductChannelOfflineSelfCustomReq.getAdjustType() == 0) {
                            //业务类型设置等于2，取 percent 百分比
                            scenicProductChannelOfflineSelfCustomReq.getPercent();
                        }
                        airportExpressChannelOfflineSelfCustomReq.setAirportExpressIncreaseStrategyRule(airportExpressIncreaseStrategySelfRule);

                        airportExpressChannelOfflineSelfCustomReqList.add(airportExpressChannelOfflineSelfCustomReq);
                    }
                    airportExpressIncreaseStrategyReq.setAirportExpressChannelOfflineSelfCustomList(airportExpressChannelOfflineSelfCustomReqList);
                }
            }

            //渠道加幅规则-线下代理商渠道
            ScenicProductAgentReq scenicProductAgentReq = channelSaleReq.getScenicProductAgentReq();
            airportExpressIncreaseStrategyReq.setAgentSalePermissionType(scenicProductAgentReq.getVisableType());
            if (airportExpressIncreaseStrategyReq.getAgentSalePermissionType() != null) {
                if (airportExpressIncreaseStrategyReq.getAgentSalePermissionType() == 2) {
                    AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategySelfRule = new AirportExpressIncreaseStrategyRuleReq();
                    //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                    if (scenicProductAgentReq.getIsLimit() == 0) {
                        airportExpressIncreaseStrategySelfRule.setSaleableType(1);
                    }
                    if (scenicProductAgentReq.getIsLimit() == 1) {
                        airportExpressIncreaseStrategySelfRule.setSaleableType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setSoldNumber(scenicProductAgentReq.getLimitNum());
                    // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                    //成人单程
                    if (scenicProductAgentReq.getAdultOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(1);
                    }
                    if (scenicProductAgentReq.getAdultOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setAdultOneWayPrice(scenicProductAgentReq.getChildrenOneWayPrice());
                    //成人往返
                    if (scenicProductAgentReq.getAdultRoundTripPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(1);
                    }

                    if (scenicProductAgentReq.getAdultRoundTripPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(2);
                    }
                    airportExpressIncreaseStrategySelfRule.setAdultRoundTripPrice(scenicProductAgentReq.getAdultRoundTripPrice());
                    //儿童
                    if (scenicProductAgentReq.getChildrenOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(1);
                    }

                    if (scenicProductAgentReq.getChildrenOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(2);
                    }
                    if (scenicProductAgentReq.getAdjustType() != null) {
                        if (scenicProductAgentReq.getAdjustType() == 0) {
                            //业务类型设置等于1 ,取amount金额
                            scenicProductAgentReq.getAmount();
                        }
                        if (scenicProductAgentReq.getAdjustType() == 0) {
                            //业务类型设置等于2，取 percent 百分比
                            scenicProductAgentReq.getPercent();
                        }
                    }
                    airportExpressIncreaseStrategyReq.setAirportExpressIncreaseStrategyAgentRule(airportExpressIncreaseStrategySelfRule);
                }
                if (airportExpressIncreaseStrategyReq.getAgentSalePermissionType() == 3) {
                    List<AirportExpressChannelOfflineAgentCustomReq> airportExpressChannelOfflineAgentCustomReqs = new ArrayList<>();

                    List<ScenicProductChannelOfflineAgentCustomReq> scenicProductChannelOfflineAgentCustomReqList = scenicProductAgentReq.getScenicProductChannelOfflineAgentCustomReqList();
                    for (ScenicProductChannelOfflineAgentCustomReq scenicProductChannelOfflineAgentCustomReq : scenicProductChannelOfflineAgentCustomReqList) {
                        AirportExpressChannelOfflineAgentCustomReq airportExpressChannelOfflineAgentCustomReq = new AirportExpressChannelOfflineAgentCustomReq();
                        airportExpressChannelOfflineAgentCustomReq.setAgentId(scenicProductChannelOfflineAgentCustomReq.getAgentId());
                        airportExpressChannelOfflineAgentCustomReq.setAgentName(scenicProductChannelOfflineAgentCustomReq.getAgentName());

                        AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategySelfRule = new AirportExpressIncreaseStrategyRuleReq();
                        //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                        if (scenicProductChannelOfflineAgentCustomReq.getIsLimit() == 0) {
                            airportExpressIncreaseStrategySelfRule.setSaleableType(1);
                        }
                        if (scenicProductChannelOfflineAgentCustomReq.getIsLimit() == 1) {
                            airportExpressIncreaseStrategySelfRule.setSaleableType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setSoldNumber(scenicProductChannelOfflineAgentCustomReq.getLimitNum());
                        // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                        //成人单程
                        if (scenicProductChannelOfflineAgentCustomReq.getAdultOneWayPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(1);
                        }
                        if (scenicProductChannelOfflineAgentCustomReq.getAdultOneWayPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setAdultOneWayPriceType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setAdultOneWayPrice(scenicProductChannelOfflineAgentCustomReq.getChildrenOneWayPrice());
                        //成人往返
                        if (scenicProductChannelOfflineAgentCustomReq.getAdultRoundTripPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(1);
                        }

                        if (scenicProductChannelOfflineAgentCustomReq.getAdultRoundTripPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setAdultRoundTripPriceType(2);
                        }
                        airportExpressIncreaseStrategySelfRule.setAdultRoundTripPrice(scenicProductChannelOfflineAgentCustomReq.getAdultRoundTripPrice());
                        //儿童
                        if (scenicProductChannelOfflineAgentCustomReq.getChildrenOneWayPriceType() == 0) {
                            airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(1);
                        }

                        if (scenicProductChannelOfflineAgentCustomReq.getChildrenOneWayPriceType() == 1) {
                            airportExpressIncreaseStrategySelfRule.setChildrenOneWayPriceType(2);
                        }

                        if (scenicProductChannelOfflineAgentCustomReq.getAdjustType() == 0) {
                            //业务类型设置等于1 ,取amount金额
                            scenicProductChannelOfflineAgentCustomReq.getAmount();
                        }
                        if (scenicProductChannelOfflineAgentCustomReq.getAdjustType() == 0) {
                            //业务类型设置等于2，取 percent 百分比
                            scenicProductChannelOfflineAgentCustomReq.getPercent();
                        }
                        airportExpressChannelOfflineAgentCustomReq.setAirportExpressIncreaseStrategyRule(airportExpressIncreaseStrategySelfRule);
                        airportExpressChannelOfflineAgentCustomReqs.add(airportExpressChannelOfflineAgentCustomReq);
                    }
                    airportExpressIncreaseStrategyReq.setAirportExpressChannelOfflineAgentCustomList(airportExpressChannelOfflineAgentCustomReqs);
                }
            }

            //渠道加幅规则-线上自营渠道官方平台
            List<ScenicProductChannelOnlineSelfPlatformReq> scenicProductChannelOnlineSelfPlatformReqList = channelSaleReq.getScenicProductChannelOnlineSelfPlatformReqList();
            List<AirportExpressChannelOnlineSelfPlatformReq> airportExpressChannelOnlineSelfPlatformReqList = new ArrayList<>();
            airportExpressIncreaseStrategyReq.setAirportExpressChannelOnlineSelfPlatformList(airportExpressChannelOnlineSelfPlatformReqList);
            AirportExpressChannelOnlineSelfPlatformReq airportExpressChannelOnlineSelfPlatformReq = null;
            if (!CollectionUtils.isEmpty(scenicProductChannelOnlineSelfPlatformReqList)) {
                for (ScenicProductChannelOnlineSelfPlatformReq scenicProductChannelOnlineSelfPlatformReq : scenicProductChannelOnlineSelfPlatformReqList) {
                    airportExpressChannelOnlineSelfPlatformReq = new AirportExpressChannelOnlineSelfPlatformReq();
                    //渠道信息
                    airportExpressChannelOnlineSelfPlatformReq.setChannelId(scenicProductChannelOnlineSelfPlatformReq.getChannelId());
                    airportExpressChannelOnlineSelfPlatformReq.setChannelName(scenicProductChannelOnlineSelfPlatformReq.getChannelName());
                    AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategyRule = new AirportExpressIncreaseStrategyRuleReq();
                    //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                    if (scenicProductChannelOnlineSelfPlatformReq.getIsLimit() == 0) {
                        airportExpressIncreaseStrategyRule.setSaleableType(1);
                    }
                    if (scenicProductChannelOnlineSelfPlatformReq.getIsLimit() == 1) {
                        airportExpressIncreaseStrategyRule.setSaleableType(2);
                    }
                    airportExpressIncreaseStrategyRule.setSoldNumber(scenicProductChannelOnlineSelfPlatformReq.getLimitNum());
                    // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                    //成人单程
                    if (scenicProductChannelOnlineSelfPlatformReq.getAdultOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setAdultOneWayPriceType(1);
                    }
                    if (scenicProductChannelOnlineSelfPlatformReq.getAdultOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setAdultOneWayPriceType(2);
                    }
                    airportExpressIncreaseStrategyRule.setAdultOneWayPrice(scenicProductChannelOnlineSelfPlatformReq.getChildrenOneWayPrice());
                    //成人往返
                    if (scenicProductChannelOnlineSelfPlatformReq.getAdultRoundTripPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setAdultRoundTripPriceType(1);
                    }

                    if (scenicProductChannelOnlineSelfPlatformReq.getAdultRoundTripPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setAdultRoundTripPriceType(2);
                    }
                    airportExpressIncreaseStrategyRule.setAdultRoundTripPrice(scenicProductChannelOnlineSelfPlatformReq.getAdultRoundTripPrice());
                    //儿童
                    if (scenicProductChannelOnlineSelfPlatformReq.getChildrenOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setChildrenOneWayPriceType(1);
                    }

                    if (scenicProductChannelOnlineSelfPlatformReq.getChildrenOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setChildrenOneWayPriceType(2);
                    }

                    if (scenicProductChannelOnlineSelfPlatformReq.getAdjustType() == 0) {
                        //业务类型设置等于1 ,取amount金额
                        scenicProductChannelOnlineSelfPlatformReq.getAmount();
                    }
                    if (scenicProductChannelOnlineSelfPlatformReq.getAdjustType() == 0) {
                        //业务类型设置等于2，取 percent 百分比
                        scenicProductChannelOnlineSelfPlatformReq.getPercent();
                    }
                    airportExpressChannelOnlineSelfPlatformReq.setAirportExpressIncreaseStrategyRule(airportExpressIncreaseStrategyRule);
                    airportExpressChannelOnlineSelfPlatformReqList.add(airportExpressChannelOnlineSelfPlatformReq);
                }
            }
            //渠道加幅规则-线上第三方平台
            List<ScenicProductChannelOnlineThirdPlatformReq> scenicProductChannelOnlineThirdPlatformReqList = channelSaleReq.getScenicProductChannelOnlineThirdPlatformReqList();
            List<AirportExpressChannelOnlineThirdPlatformReq> airportExpressChannelOnlineThirdPlatformList = new ArrayList<>();
            airportExpressIncreaseStrategyReq.setAirportExpressChannelOnlineThirdPlatformList(airportExpressChannelOnlineThirdPlatformList);
            AirportExpressChannelOnlineThirdPlatformReq airportExpressChannelOnlineThirdPlatformReq = null;
            if (!CollectionUtils.isEmpty(scenicProductChannelOnlineThirdPlatformReqList)) {
                for (ScenicProductChannelOnlineThirdPlatformReq scenicProductChannelOnlineThirdPlatformReq : scenicProductChannelOnlineThirdPlatformReqList) {
                    airportExpressChannelOnlineThirdPlatformReq = new AirportExpressChannelOnlineThirdPlatformReq();
                    //渠道信息
                    airportExpressChannelOnlineThirdPlatformReq.setPlatformId(scenicProductChannelOnlineThirdPlatformReq.getPlatformId());
                    airportExpressChannelOnlineThirdPlatformReq.setPlatformName(scenicProductChannelOnlineThirdPlatformReq.getPlatformName());
                    AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategyRule = new AirportExpressIncreaseStrategyRuleReq();
                    //是否限购转换（门票景点 0：不限购  1：限购） =》  （业务 1：不限购 2 ：限购）
                    if (scenicProductChannelOnlineThirdPlatformReq.getIsLimit() == 0) {
                        airportExpressIncreaseStrategyRule.setSaleableType(1);
                    }
                    if (scenicProductChannelOnlineThirdPlatformReq.getIsLimit() == 1) {
                        airportExpressIncreaseStrategyRule.setSaleableType(2);
                    }
                    airportExpressIncreaseStrategyRule.setSoldNumber(scenicProductChannelOnlineThirdPlatformReq.getLimitNum());
                    // 数值百分比转换（门票景点  0：加数值  1：百分比） =》（业务 1：加数值 2：百分比）
                    //成人单程
                    if (scenicProductChannelOnlineThirdPlatformReq.getAdultOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setAdultOneWayPriceType(1);
                    }
                    if (scenicProductChannelOnlineThirdPlatformReq.getAdultOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setAdultOneWayPriceType(2);
                    }
                    airportExpressIncreaseStrategyRule.setAdultOneWayPrice(scenicProductChannelOnlineThirdPlatformReq.getChildrenOneWayPrice());
                    //成人往返
                    if (scenicProductChannelOnlineThirdPlatformReq.getAdultRoundTripPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setAdultRoundTripPriceType(1);
                    }

                    if (scenicProductChannelOnlineThirdPlatformReq.getAdultRoundTripPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setAdultRoundTripPriceType(2);
                    }
                    airportExpressIncreaseStrategyRule.setAdultRoundTripPrice(scenicProductChannelOnlineThirdPlatformReq.getAdultRoundTripPrice());
                    //儿童
                    if (scenicProductChannelOnlineThirdPlatformReq.getChildrenOneWayPriceType() == 0) {
                        airportExpressIncreaseStrategyRule.setChildrenOneWayPriceType(1);
                    }

                    if (scenicProductChannelOnlineThirdPlatformReq.getChildrenOneWayPriceType() == 1) {
                        airportExpressIncreaseStrategyRule.setChildrenOneWayPriceType(2);
                    }

                    if (scenicProductChannelOnlineThirdPlatformReq.getAdjustType() == 0) {
                        //业务类型设置等于1 ,取amount金额
                        scenicProductChannelOnlineThirdPlatformReq.getAmount();
                    }
                    if (scenicProductChannelOnlineThirdPlatformReq.getAdjustType() == 0) {
                        //业务类型设置等于2，取 percent 百分比
                        scenicProductChannelOnlineThirdPlatformReq.getPercent();
                    }
                    airportExpressChannelOnlineThirdPlatformReq.setAirportExpressIncreaseStrategyRule(airportExpressIncreaseStrategyRule);
                    airportExpressChannelOnlineThirdPlatformList.add(airportExpressChannelOnlineThirdPlatformReq);
                }
            }
        }

        return airportExpressIncreaseStrategySaveBatchReq;

    }

    private AirportExpressIncreaseStrategyRuleReq changeStrategyRule() {
        AirportExpressIncreaseStrategyRuleReq airportExpressIncreaseStrategyRuleReq = new AirportExpressIncreaseStrategyRuleReq();
        return airportExpressIncreaseStrategyRuleReq;
    }

}
